home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / tpasswo2.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1019 b   |  38 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TPasswordInputLine
  4. //    Include File:    tpasswor.h
  5. //    Purpose:    Implement a password input line.
  6. //    Remarks/Portability/Dependencies/Restrictions:
  7. //    Revision History:
  8. //        04-22-94    created.
  9. #include"tpasswor.h"
  10. #include<string.h>
  11.  
  12. void TPasswordInputLine::draw()    {
  13. //    Purpose:    Draw the input line without showing what was really
  14. //            entered as the password.
  15. //    Arguments:    void
  16. //    Return Value:    void
  17. //    Remarks/Portability/Dependencies/Restrictions:
  18. //        Kludge to swap in and out password information before
  19. //        drawing takes place.
  20. //    Revision History:
  21. //        04-22-94    created
  22.  
  23.     //    Save the current information.
  24.     auto char *cp_savepass = newStr(data);
  25.  
  26.     //    Make current password all indecernable.
  27.     auto char *cp_convert = data;
  28.     while(*cp_convert != '\0')    {
  29.         *cp_convert++ = '*';
  30.     }
  31.  
  32.     //    Have base class draw.
  33.     TInputLine::draw();
  34.  
  35.     //    Restore old password.
  36.     strcpy(data, cp_savepass);
  37.     delete(cp_savepass);
  38. }